package com.web.kdl.daoV2.matrix;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.web.kdl.entity.matrix.Matrix;
import com.web.kdl.pojo.Bo.MatrixBo;
import com.web.kdl.pojo.Vo.MatrixVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MatrixDao extends BaseMapper<Matrix> {
    @Select("select * from matrix where matrix_name=#{matrixName}")
    Matrix selectByName(String matrixName);

    List<MatrixBo> selectMatrixTable();
    @Select("SELECT matrix.wheel_number as wheelNumber," +
            "matrix.matrix_name as matrixName," +
            "matrix.topic as topic," +
            "matrix.create_time as createTime," +
            "matrix.update_time as updateTime," +
            "site.sum_site as siteName " +
            "FROM matrix " +
            "INNER JOIN site ON matrix.site_id = site.id")
    List<MatrixVo> getMatrixList();


    MatrixVo selectMatrixById(Integer id);
}
